import React, { Component } from 'react';
import { StyleSheet, View, Text, } from 'react-native';
import { GLOBAL } from '../../../../config/global';
import { orderStyle, commonStyle } from '../_common/style';
const scale = GLOBAL.SCALE;
export class LieCpt extends Component {
    constructor(props) {
        super(props);
        let { visible } = props.data || {};
        this.state = {
            visible
        }
    }

    render () {
        let { data,iWidth } = this.props || {};
        return (
            <View style={[commonStyle.row3, { paddingTop: 10 * scale }]}>
                <Text style={orderStyle.lable}>{data.lable}</Text>
                <View style={orderStyle.valueBox}>
                    {
                        data.value && data.value.map((item, index) => {
                            return (
                                <View key={index} style={[{ width:iWidth ? iWidth*scale:230 * scale }, commonStyle.row3, orderStyle.lineFeed, index != 0 ? orderStyle.notFirst : null]} >
                                    {item && item.map((items, indexs) => {
                                        if (indexs < item.length - 1) {
                                            return (
                                                <View style={[commonStyle.row3]} key={indexs}>
                                                    <Text onPress={() => { data.itemCallBack && data.itemCallBack() }} style={[orderStyle.value, data.itemCallBack ? orderStyle.loadColor : null]} key={indexs}>{items}</Text>
                                                    <Text style={[orderStyle.xian]}>|</Text>
                                                </View>

                                            )
                                        } else {
                                            return (
                                                <Text onPress={() => { indexs == 0 && data.itemCallBack && data.itemCallBack() }} style={[orderStyle.value, data.isCallBack && indexs == 0 ? orderStyle.loadColor : null]} key={indexs}>{items}</Text>
                                            )
                                        }

                                    })}
                                </View>
                            )
                        })
                    }
                </View>
            </View>
        )
    }
}

const styles = StyleSheet.create({

})